﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FreeGoo.GameEngine.Behaviors;
using FreeGoo.GameEngine.Renderables;

namespace FreeGoo.LevelClasses.BehaviorParts
{
    public class ResistsCollissionBehaviorPart : BehaviorPart
    {
        public override string Name { get { return "ResistsCollission"; } }

        public override void AddBehaviorToRenderable(Level level, FreeGoo.GameEngine.Renderables.Renderable renderable, FreeGoo.LevelClasses.LevelParts.LevelPart levelPart, System.Xml.Linq.XElement element)
        {
            ResistsCollission resistsCollission = new ResistsCollission(renderable as BodyRenderable);
            Renderable resistRenderable = level.Engine.GetRenderableById(element.Attribute("Resists").Value);
            resistsCollission.Resists.Add(resistRenderable as BodyRenderable);
        }
    }
}
